<?php
$im_height = 30;
$im_width = 220;
$im_font_size = 18;
$im_bg = '028028028';

$text = 'No Text';
$font_str = 'HPARK.ttf';

if (isset($_GET['im_height'])) {
	$im_height = $_GET['im_height'];
}
if (isset($_GET['im_width'])) {
	$im_width = $_GET['im_width'];
}
if (isset($_GET['im_font_size'])) {
	$im_font_size = $_GET['im_font_size'];
}
if (isset($_GET['im_text'])) {
	$text = urldecode($_GET['im_text']);
}
if (isset($_GET['im_font'])) {
	$font_str = urldecode($_GET['im_font']).".ttf";
}
if (isset($_GET['im_bg'])) {
	$im_bg = urldecode($_GET['im_bg']);
}

header('Content-type: image/png');


// The text to draw

// Replace path by your own font path

$im = imagecreatetruecolor($im_width, $im_height);

$red = substr($im_bg, 0 , 3);
$green = substr($im_bg, 3 , 3);
$blue = substr($im_bg, 6 , 3);

$back = imagecolorallocate($im, $red, $green, $blue);
imagefill($im, 0, 0, $back);

$gold = imagecolorallocate($im, 227, 198, 68);

// Add some shadow to the text

imagettftext($im, $im_font_size, 0, 0, 29, $gold, $font_str, $text);


imagepng($im);
imagedestroy($im);
?>